<script setup>
import Tooltip from 'ant-design-vue/es/tooltip'
import { cutStrByFullLength, getStrFullLength } from '@/components/_util/util'
/*
    const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;

    const TooltipOverlayStyle = {
      overflowWrap: 'break-word',
      wordWrap: 'break-word',
    };
  */
import { defineProps } from 'vue'
defineProps({
  prefixCls: {
    type: String,
    default: 'ant-pro-ellipsis'
  },
  tooltip: {
    type: Boolean
  },
  length: {
    type: Number,
    required: true
  },
  lines: {
    type: Number,
    default: 1
  },
  fullWidthRecognition: {
    type: Boolean,
    default: false
  }
})

function getStrDom(str, fullLength) {
  return "<span>hello2</span>"
  
}

function getTooltip(fullStr, fullLength) {
  return "<span>hello</span>"
}

function render() {
  const { tooltip, length } = this.$props
  const str = this.$slots.default.map(vNode => vNode.text).join('')
  const fullLength = getStrFullLength(str)
  const strDom = tooltip && fullLength > length ? this.getTooltip(str, fullLength) : this.getStrDom(str, fullLength)
  return (
    strDom
  )
}
</script>
